package Calculator;

import java.util.Date;
import java.util.Timer;
import java.util.TimerTask;

public class TimedExit {          // 错误输入 5 秒后关闭窗口的类
    Timer timer = new Timer();
    TimerTask exitApp = new TimerTask() {
        public void run() {
            System.exit(0);
        }
    };
    public TimedExit() {
        timer.schedule(exitApp, new Date(System.currentTimeMillis() + 5 * 1000));
    }
}